#include "bgimageitem.h"
#include <QMenu>
#include <QPixmap>
#include "curvescene.h"

BGImageItem::BGImageItem(const QPixmap& pixmap, QGraphicsItem *parent,
                         CurveScene *scene) :
    QGraphicsPixmapItem(pixmap, parent, scene)
{
    setOpacity(0.5);
    setZValue(0);
}

//void BGImageItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
//{
//    QMenu menu("Obraz", this);
//    menu.addAction("Zablokuj");
//    menu.addAction("")
//}

void BGImageItem::setMovable(bool value)
{
    setFlag(QGraphicsItem::ItemIsMovable, value && locked);
}

void BGImageItem::setLocked(bool value)
{
    locked = value;
    setMovable(value);
}


